gtkbindings: Add an example for gtk_binding_entry_add_signal()
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 22 Aug 2016 14:39:02 +0000 (15:39 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 23 Aug 2016 10:51:13 +0000 (11:51 +0100)
Otherwise the way the varargs are supposed to be used is completely
opaque.

https://bugzilla.gnome.org/show_bug.cgi?id=770236

gtk/gtkbindings.c

index f71fcac335c65ac93b0ad3d6b2bb46ea3661f9a2..a06a050a9b5a5d5f2aa2a77cc6a3d0d0b9561544 100644 (file)
@@ -993,6 +993,20 @@ _gtk_binding_entry_add_signall (GtkBindingSet  *binding_set,
  * @binding_set. When the binding is activated, @signal_name will be
  * emitted on the target widget, with @n_args @Varargs used as
  * arguments.
+ *
+ * Each argument to the signal must be passed as a pair of varargs: the
+ * #GType of the argument, followed by the argument value (which must
+ * be of the given type). There must be @n_args pairs in total.
+ *
+ * ## Adding a Key Binding
+ *
+ * |[<!-- language="C" -->
+ * gtk_binding_entry_add_signal (binding_set, keyval, modmask,
+ *                               "move-cursor", 3,
+ *                               G_TYPE_ENUM, step,
+ *                               G_TYPE_INT, count,
+ *                               G_TYPE_BOOLEAN, FALSE);
+ * ]|
  */
 void
 gtk_binding_entry_add_signal (GtkBindingSet  *binding_set,